package com.ge.modules.api.secondController;

import com.ge.common.annotation.LoginStoreApi;
import com.ge.common.utils.R;
import com.ge.modules.api.service.TbStoreCommentService;
import com.ge.modules.entity.TbStoreCommentEntity;
import com.ge.modules.entity.TbStoreEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 店铺评论表
 *
 * @author lanyonglin
 * @email www.baidu.com
 * @date 2018-07-17 15:12:58
 */
@RestController
@RequestMapping("/api/store/storecomment")
public class TbStoreCommentController {

    @Autowired
    private TbStoreCommentService storeCommentService;

    /**
     * 查询店铺评论列表
     *
     * @param tbStore
     * @return
     */
    @GetMapping("/list")
    public R list(@LoginStoreApi TbStoreEntity tbStore) {
        Map<String, Object> map = new HashMap<>();
        map.put("storeIdSlave", tbStore.getStoreId());
        List<TbStoreCommentEntity> tbStoreCommentEntities = storeCommentService.queryList(map);
        return R.ok().put("data", tbStoreCommentEntities);
    }

}
